home *** CD-ROM | disk | FTP | other *** search
- /* atof.c, from p.170 of Turbo C Bible */
- /* Converts a string to a double-precision floating-point value. */
- #include <stdio.h>
- #include <math.h>
- main(int argc, char **argv)
- {
- double value;
- if(argc < 2)
- {
- printf("Usage: %s <value>\n", argv[0]);
- }
- else
- {
- value = atof(argv[1]);
- printf("Value entered = %g\n", value);
- }
- }